#pragma once
#include "yzrutil.h"

namespace yzrilyzr_util{
	EBCLASS(Locale){
	private:
	yzrilyzr_lang::String language;
	yzrilyzr_lang::String country;
	yzrilyzr_lang::String variant;
	public:
	Locale();
	Locale(const yzrilyzr_lang::String & language, const yzrilyzr_lang::String & country, const yzrilyzr_lang::String & variant);
	Locale(const yzrilyzr_lang::String & language, const yzrilyzr_lang::String & country);

	  // 获取语言代码
	const yzrilyzr_lang::String & getLanguage() const noexcept{ return language; }
	// 获取国家/地区代码
	const yzrilyzr_lang::String & getCountry() const noexcept{ return country; }
	// 获取变体
	const yzrilyzr_lang::String & getVariant() const noexcept{ return variant; }
	static std::shared_ptr<Locale> getDefault();
	yzrilyzr_lang::String toString() const override;
	bool operator==(const Locale & other) const noexcept;
	bool operator!=(const Locale & other) const noexcept;
	};
	namespace Locales{
		extern const std::shared_ptr<Locale> SIMPLIFIED_CHINESE;
		extern const std::shared_ptr<Locale> ENGLISH;
		extern const std::shared_ptr<Locale> US;
	}
}